package com.x.service.entity.map;

import com.x.service.entity.TagList;
import com.x.zssqservice.bean.BookListTags;

import java.util.ArrayList;

/**
 * Created by H on 18/5/9.
 */

public class BookListTagsToTagList implements IMap<BookListTags, TagList> {
    @Override
    public TagList map(BookListTags bookListTags) {
        TagList tagList = new TagList();
        tagList.ok = bookListTags.ok;
        tagList.major = new ArrayList<>();
        for (BookListTags.DataBean dataBean : bookListTags.data) {
            TagList.Tag tag = new TagList.Tag();
            tag.name = dataBean.name;
            tag.minors1 = dataBean.tags;
            tagList.major.add(tag);
        }
        return tagList;
    }
}
